package com.xcity.game.employee;

public enum EmployeeQuality {

	D(95),     // 0
	C(100),    // 1
	B(105),    // 2
	A(115),    // 3
	AA(125),   // 4
	AAA(135),  // 5
	S(150),    // 6
	;
	
	/** 战斗力评分 */
	public final int score;
	
	EmployeeQuality(int score) {
		this.score = score;
	}
	
	static EmployeeQuality[] vals = values();
	public static EmployeeQuality forCode(int quality) {
		return quality >= 0 && quality < vals.length ? vals[quality] : null;
	}
	
	public static EmployeeQuality forName(String name) {
		if ("D".equals(name)) {
			return D;
		}
		if ("C".equals(name)) {
			return C;
		}
		if ("B".equals(name)) {
			return B;
		}
		if ("A".equals(name)) {
			return A;
		}
		if ("AA".equals(name)) {
			return AA;
		}
		if ("AAA".equals(name)) {
			return AAA;
		}
		if ("S".equals(name)) {
			return S;
		}
		return null;
	}
	
	public static int length() {
		return vals.length;
	}
	
}
